import {PureComponent} from "react";
import {connect} from "react-redux";

class Display extends PureComponent {
    render() {
        const {banner, recommend} = this.props;
        return (
            <div>
                <ul>
                    {banner.map((item, index) => <li key={index}>{item.title}</li>)}
                </ul>
                <ul>
                    {recommend.map((item, index) => <li key={index}>{item.title}</li>)}
                </ul>
            </div>
        )
    }
}

const mapStateToProps = (state) => ({banner: state.home.banner, recommend: state.home.recommend})
export default connect(mapStateToProps)(Display)